package java201521123069;

import java.util.Scanner;
public class Test2{

	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		String str;
		int a,c,i,result;
		str=input.next();
		while(str!=null)
		{
			result=0;
			c=Integer.parseInt(str);
			if(c>=10000&&c<=20000)
			{
				System.out.println(Integer.toBinaryString(c)+","+Integer.toOctalString(c)+","+Integer.toHexString(c));
			}
			else
			{
				if(c>=0)
					i=0;
				else
					i=1;
				char []Arr=str.toCharArray();
				for(;i<Arr.length;i++)
				{
					a=Arr[i]-'0';
					System.out.print(a+" ");
					result+=a;
				}
				System.out.println(result);
				
				
			}
			str=input.next();
	
	  }		

	}

}
